FROM openjdk:8-alpine

RUN echo "http://mirrors.aliyun.com/alpine/latest-stable/main/" > /etc/apk/repositories
RUN echo "http://mirrors.aliyun.com/alpine/latest-stable/community/" >> /etc/apk/repositories

RUN apk --no-cache add nginx
RUN mkdir -p /run/nginx
RUN mkdir -p /app/logs

COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY docker/run.sh /app/run.sh
COPY target/demo-*.jar /app/server/demo.jar

EXPOSE 80
EXPOSE 8080

CMD ["sh", "/app/run.sh" ]
